<?php

namespace app\common\model;

use think\Request;

/**
 * 配送员图片模型类
 * Class User
 * @package app\common\model
 */
class DeliveryImg extends BaseModel
{
    protected $name = 'delivery_img';



    /**
     * 获取配送员图片列表
     * @return \think\Paginator
     * @throws \think\exception\DbException
     */
    public function getList()
    {
        $request = Request::instance();
        return $this->order(['create_time' => 'desc'])
            ->paginate(15, false, ['query' => $request->request()]);
    }

    /**
     * 获取配送员图片信息
     * @param $where
     * @return null|static
     * @throws \think\exception\DbException
     */
    public static function detail($where)
    {
        return self::get($where, ['address', 'addressDefault']);
    }

}
